import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/Layout'),
    children: [
      {
        path: '', // 如果不写路径则为父路由的默认子路由和重定向一个效果
        component: () => import('@/views//Layout/Home/Home')
      },
      {
        path: '/video',
        component: () => import('@/views//Layout/Video/Video')
      },
      {
        path: '/qs',
        component: () => import('@/views//Layout/Qs/Qs')
      },
      {
        path: '/profile',
        component: () => import('@/views//Layout/Profile/Profile')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('../views/Login.vue') // 如果不需要将组件合并打包不需要写前面的那个
  }
]

const router = new VueRouter({
  routes
})

export default router
